package com.hsteach.framework.web;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum TeacherJobEnum {

    JSBJZW_3("JSBJZW_3", "科任老师"),
    enum1("", "班主任"),
    enum2("", "副班主任"),
    enum3("", "一般教职工"),
    ;

    private String code;
    private String name;

    public static boolean inTeacherJob(String code) {
        TeacherJobEnum teacherJobEnum = Arrays.stream(TeacherJobEnum.values()).filter(e -> e.code.equals(code)).findFirst().orElse(null);
        if (teacherJobEnum != null) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean inTeacherJobByName(String name) {
        TeacherJobEnum teacherJobEnum = Arrays.stream(TeacherJobEnum.values()).filter(e -> e.name.equals(name)).findFirst().orElse(null);
        if (teacherJobEnum != null) {
            return true;
        } else {
            return false;
        }
    }
}
